#pragma once
#include "stdafx.h"
#include "EntityControl.h"
#include "IParameterChangedListener.h"
#include "EntityParameter.h"
#include "Trigger.h"

class EntityControl;
class Trigger;


class TriggerRequirement :public IParameterChangedListener
{

	Trigger *ownerTrigger;
	bool prevResult;

public:
	virtual bool CheckReq(EntityControl *entity)=0;

	virtual void subscribeParameterChanged(EntityControl *entity,TriggerRequirement*req )=0;
	virtual void unSubscribeParameterChanged(EntityControl *entity,TriggerRequirement*req )=0;

	virtual void parameterChanged(EntityControl *sourceEntity, std::string parameterName, EntityParameter *oldValue, EntityParameter *newValue);

	virtual void setOwnerTrigger(Trigger *trigger);

	virtual void setResult(bool result);
	virtual bool getPrevResult();

	TriggerRequirement(void);
	virtual ~TriggerRequirement(void);

};

